import { TRuneExtraNum } from "../../../Message/Db/Tables/TRuneExtraNum";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class RuneExtraConfig
    
    export  class RuneExtraConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (RuneExtraConfig._instance != null) 
            {
                throw new Error(" RuneEffectConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TRuneExtraNum();
                loc1.materialNum = loc2.materialNum;
                loc1.runeNum = loc2.runeNum;
                loc1.runeType = loc2.runeType;
                this._map[loc2.runeType + "_" + loc2.runeNum] = loc1;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_rune_extra_num.json");
            this.write(loc1);
            return;
        }

        public getInfoByTypeAndNum(arg1: int, arg2: int): TRuneExtraNum
        {
            return this._map[arg1 + "_" + arg2];
        }

        public static get instance(): RuneExtraConfig
        {
            if (RuneExtraConfig._instance == null) 
            {
                RuneExtraConfig._instance = new RuneExtraConfig();
            }
            return RuneExtraConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: RuneExtraConfig;
    }
